function [US,WM,SYNC_WM,SYNC_US] = sync2equal1(US1,US2,WM2,dif)

    WM=WM2(1:length(US2));
    US=US2;
    
    if dif > 0 % US Signal before the WM signal        
        SYNC_WM = WM2((dif+1):length(US1)+dif);
        SYNC_US=US2;
    else
        if dif < 0 % WM Signal before the US signal
            %Need to loose the begining from US since WM started before
            SYNC_US = US2(abs(dif)+1:length(US2));        
            SYNC_WM = WM2(1:length(US1));        
        else % frame_diference_xcorr == 0 - WM Signal already sincronyzed ith US
            SYNC_WM = WM2(1:length(US1));
            SYNC_US=US2;
        end
    end
end